﻿using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Diagnostics.CodeAnalysis;

namespace SubStationManagement.Server.Models
{
    public class HarmonicSample
    {
        [BsonId]
        [BsonRepresentation(BsonType.ObjectId)]
        [Display(Name = "Id")]
        [NotNull]
        public string? Id { get; set; }

        /// <summary>
        /// 获得/设置 模块Id
        /// </summary>
        [Display(Name = "模块Id")]
        [NotNull, Required]
        public int ModuleId { get; set; }

        /// <summary>
        /// 获得/设置 回路编号
        /// </summary>
        [Display(Name = "回路编号")]
        [NotNull, Required]
        public EnumMeasureLoopNumber LoopNumber { get; set; }

        /// <summary>
        /// 获得/设置 时间戳
        /// </summary>
        [Display(Name = "时间戳")]
        [NotNull, Required]
        public DateTime TimeStamp { get; set; }

        /// <summary>
        /// 获得/设置 类型
        /// </summary>
        [Display(Name = "类型")]
        [NotNull, Required]
        public EnumHarmonicModuleChannel Type { get; set; }

        /// <summary>
        /// 获得/设置 A相电压有效值
        /// </summary>
        [Display(Name = "基波值")]
        public double? H1 { get; set; }

        /// <summary>
        /// 获得/设置 2次谐波
        /// </summary>
        [Display(Name = "2次谐波")]
        public double? H2 { get; set; }

        /// <summary>
        /// 获得/设置 3次谐波
        /// </summary>
        [Display(Name = "3次谐波")]
        public double? H3 { get; set; }

        /// <summary>
        /// 获得/设置 4次谐波
        /// </summary>
        [Display(Name = "4次谐波")]
        public double? H4 { get; set; }

        /// <summary>
        /// 获得/设置 5次谐波
        /// </summary>
        [Display(Name = "5次谐波")]
        public double? H5 { get; set; }

        /// <summary>
        /// 获得/设置 6次谐波
        /// </summary>
        [Display(Name = "6次谐波")]
        public double? H6 { get; set; }

        /// <summary>
        /// 获得/设置 7次谐波
        /// </summary>
        [Display(Name = "7次谐波")]
        public double? H7 { get; set; }

        /// <summary>
        /// 获得/设置 8次谐波
        /// </summary>
        [Display(Name = "8次谐波")]
        public double? H8 { get; set; }

        /// <summary>
        /// 获得/设置 9次谐波
        /// </summary>
        [Display(Name = "9次谐波")]
        public double? H9 { get; set; }

        /// <summary>
        /// 获得/设置 10次谐波
        /// </summary>
        [Display(Name = "10次谐波")]
        public double? H10 { get; set; }

        /// <summary>
        /// 获得/设置 11次谐波
        /// </summary>
        [Display(Name = "11次谐波")]
        public double? H11 { get; set; }

        /// <summary>
        /// 获得/设置 12次谐波
        /// </summary>
        [Display(Name = "12次谐波")]
        public double? H12 { get; set; }

        /// <summary>
        /// 获得/设置 13次谐波
        /// </summary>
        [Display(Name = "13次谐波")]
        public double? H13 { get; set; }

        /// <summary>
        /// 获得/设置 14次谐波
        /// </summary>
        [Display(Name = "14次谐波")]
        public double? H14 { get; set; }

        /// <summary>
        /// 获得/设置 15次谐波
        /// </summary>
        [Display(Name = "15次谐波")]
        public double? H15 { get; set; }

        /// <summary>
        /// 获得/设置 16次谐波
        /// </summary>
        [Display(Name = "16次谐波")]
        public double? H16 { get; set; }
    }

    public enum EnumHarmonicModuleChannel
    {
        /// <summary>
        /// 
        /// </summary>
        [Description("A相电流谐波")]
        IA,
        /// <summary>
        /// 
        /// </summary>
        [Description("B相电流谐波")]
        IB,
        /// <summary>
        /// 
        /// </summary>
        [Description("C相电流谐波")]
        IC,

        /// <summary>
        /// 
        /// </summary>
        [Description("A相电压谐波")]
        VA,
        /// <summary>
        /// 
        /// </summary>
        [Description("B相电压谐波")]
        VB,
        /// <summary>
        /// 
        /// </summary>
        [Description("C相电压谐波")]
        VC,
    }
}
